3.399 \(\int \cos ^m(c+d x) (a+a \cos (c+d x))^2 \, dx\)

Optimal. Leaf size=173 \[ -\frac{a^2 (2 m+3) \sin (c+d x) \cos ^{m+1}(c+d x) \, _2F_1\left (\frac{1}{2},\frac{m+1}{2};\frac{m+3}{2};\cos ^2(c+d x)\right )}{d (m+1) (m+2) \sqrt{\sin ^2(c+d x)}}-\frac{2 a^2 \sin (c+d x) \cos ^{m+2}(c+d x) \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(c+d x)\right )}{d (m+2) \sqrt{\sin ^2(c+d x)}}+\frac{a^2 \sin (c+d x) \cos ^{m+1}(c+d x)}{d (m+2)} \]

[Out]

(a^2*Cos[c + d*x]^(1 + m)*Sin[c + d*x])/(d*(2 + m)) - (a^2*(3 + 2*m)*Cos[c + d*x]^(1 + m)*Hypergeometric2F1[1/
2, (1 + m)/2, (3 + m)/2, Cos[c + d*x]^2]*Sin[c + d*x])/(d*(1 + m)*(2 + m)*Sqrt[Sin[c + d*x]^2]) - (2*a^2*Cos[c
 + d*x]^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[c + d*x]^2]*Sin[c + d*x])/(d*(2 + m)*Sqrt[Sin
[c + d*x]^2])

________________________________________________________________________________________

Rubi [A]  time = 0.139103, antiderivative size = 173, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {2763, 2748, 2643} \[ -\frac{a^2 (2 m+3) \sin (c+d x) \cos ^{m+1}(c+d x) \, _2F_1\left (\frac{1}{2},\frac{m+1}{2};\frac{m+3}{2};\cos ^2(c+d x)\right )}{d (m+1) (m+2) \sqrt{\sin ^2(c+d x)}}-\frac{2 a^2 \sin (c+d x) \cos ^{m+2}(c+d x) \, _2F_1\left (\frac{1}{2},\frac{m+2}{2};\frac{m+4}{2};\cos ^2(c+d x)\right )}{d (m+2) \sqrt{\sin ^2(c+d x)}}+\frac{a^2 \sin (c+d x) \cos ^{m+1}(c+d x)}{d (m+2)} \]

Antiderivative was successfully verified.

[In]

Int[Cos[c + d*x]^m*(a + a*Cos[c + d*x])^2,x]

[Out]

(a^2*Cos[c + d*x]^(1 + m)*Sin[c + d*x])/(d*(2 + m)) - (a^2*(3 + 2*m)*Cos[c + d*x]^(1 + m)*Hypergeometric2F1[1/
2, (1 + m)/2, (3 + m)/2, Cos[c + d*x]^2]*Sin[c + d*x])/(d*(1 + m)*(2 + m)*Sqrt[Sin[c + d*x]^2]) - (2*a^2*Cos[c
 + d*x]^(2 + m)*Hypergeometric2F1[1/2, (2 + m)/2, (4 + m)/2, Cos[c + d*x]^2]*Sin[c + d*x])/(d*(2 + m)*Sqrt[Sin
[c + d*x]^2])

Rule 2763

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> -Si
mp[(b^2*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f*x])^(n + 1))/(d*f*(m + n)), x] + Dist[1/(d*
(m + n)), Int[(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f*x])^n*Simp[a*b*c*(m - 2) + b^2*d*(n + 1) + a^2*d*(
m + n) - b*(b*c*(m - 1) - a*d*(3*m + 2*n - 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 1] &&  !LtQ[n, -1] && (IntegersQ[2*m, 2*
n] || IntegerQ[m + 1/2] || (IntegerQ[m] && EqQ[c, 0]))

Rule 2748

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[c, Int[(b*S
in[e + f*x])^m, x], x] + Dist[d/b, Int[(b*Sin[e + f*x])^(m + 1), x], x] /; FreeQ[{b, c, d, e, f, m}, x]

Rule 2643

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(Cos[c + d*x]*(b*Sin[c + d*x])^(n + 1)*Hypergeomet
ric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2])/(b*d*(n + 1)*Sqrt[Cos[c + d*x]^2]), x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rubi steps

\begin{align*} \int \cos ^m(c+d x) (a+a \cos (c+d x))^2 \, dx &=\frac{a^2 \cos ^{1+m}(c+d x) \sin (c+d x)}{d (2+m)}+\frac{\int \cos ^m(c+d x) \left (a^2 (3+2 m)+2 a^2 (2+m) \cos (c+d x)\right ) \, dx}{2+m}\\ &=\frac{a^2 \cos ^{1+m}(c+d x) \sin (c+d x)}{d (2+m)}+\left (2 a^2\right ) \int \cos ^{1+m}(c+d x) \, dx+\frac{\left (a^2 (3+2 m)\right ) \int \cos ^m(c+d x) \, dx}{2+m}\\ &=\frac{a^2 \cos ^{1+m}(c+d x) \sin (c+d x)}{d (2+m)}-\frac{a^2 (3+2 m) \cos ^{1+m}(c+d x) \, _2F_1\left (\frac{1}{2},\frac{1+m}{2};\frac{3+m}{2};\cos ^2(c+d x)\right ) \sin (c+d x)}{d (1+m) (2+m) \sqrt{\sin ^2(c+d x)}}-\frac{2 a^2 \cos ^{2+m}(c+d x) \, _2F_1\left (\frac{1}{2},\frac{2+m}{2};\frac{4+m}{2};\cos ^2(c+d x)\right ) \sin (c+d x)}{d (2+m) \sqrt{\sin ^2(c+d x)}}\\ \end{align*}

Mathematica [F]  time = 0.534615, size = 0, normalized size = 0. \[ \int \cos ^m(c+d x) (a+a \cos (c+d x))^2 \, dx \]

Verification is Not applicable to the result.

[In]

Integrate[Cos[c + d*x]^m*(a + a*Cos[c + d*x])^2,x]

[Out]

Integrate[Cos[c + d*x]^m*(a + a*Cos[c + d*x])^2, x]

________________________________________________________________________________________

Maple [F]  time = 2.961, size = 0, normalized size = 0. \begin{align*} \int \left ( \cos \left ( dx+c \right ) \right ) ^{m} \left ( a+\cos \left ( dx+c \right ) a \right ) ^{2}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(d*x+c)^m*(a+cos(d*x+c)*a)^2,x)

[Out]

int(cos(d*x+c)^m*(a+cos(d*x+c)*a)^2,x)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \cos \left (d x + c\right ) + a\right )}^{2} \cos \left (d x + c\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^m*(a+a*cos(d*x+c))^2,x, algorithm="maxima")

[Out]

integrate((a*cos(d*x + c) + a)^2*cos(d*x + c)^m, x)

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left ({\left (a^{2} \cos \left (d x + c\right )^{2} + 2 \, a^{2} \cos \left (d x + c\right ) + a^{2}\right )} \cos \left (d x + c\right )^{m}, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^m*(a+a*cos(d*x+c))^2,x, algorithm="fricas")

[Out]

integral((a^2*cos(d*x + c)^2 + 2*a^2*cos(d*x + c) + a^2)*cos(d*x + c)^m, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)**m*(a+a*cos(d*x+c))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int{\left (a \cos \left (d x + c\right ) + a\right )}^{2} \cos \left (d x + c\right )^{m}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(d*x+c)^m*(a+a*cos(d*x+c))^2,x, algorithm="giac")

[Out]

integrate((a*cos(d*x + c) + a)^2*cos(d*x + c)^m, x)